<?php
header('Content-Type:text/html; charset=utf-8');
include ("datos/conexion.php");
session_start();
$arreglo = Array();
$lista = Array();
$ced = $_POST['ced'];
$msj = '';
if (isset($_SESSION['usuario'])) {
	$consulta2 = "SELECT * FROM visitante where cedula='".$ced."'";
	$result2 = mysql_query($consulta2, $conexion);
	if (!$result2) {
		$msj = 'Error: ' . mysql_error();
	} else {
		$num_rows2 = mysql_num_rows($result2);
		if ($num_rows2 != 0) {
			while ($lst = mysql_fetch_assoc($result2)) {
				foreach ($lst as $clave => $valor){
					$lista[$clave] = $valor;
				}	
			}
			$arreglo['resp'] = 1;
			$arreglo['lista'] = $lista;
		} else {
			$arreglo['resp'] = 0;
		}
	}

	echo $msj;
} else {
	$arreglo['resp'] = 0;
}
echo json_encode($arreglo);
?>

